//
//  Float+Extenson.swift
//  DoctorEPlus
//
//  Created by 王林波 on 2020/10/27.
//

import Foundation
import UIKit

extension CGFloat {
    
    var radius: CGFloat {
        return self*UIScreen.scaleRadius
    }
}


extension Int {
    
    // 秒数转时间显示
    var time: String  {
        if self == 0 {
            return "00:00:00"
        }else {
            let hour = self/3600
            let min = self/60 - hour*60
            let sec = self - min*60 - hour*3600
            var str = ""
            if hour != 0 {
                str = String(format: "%02d:%02d:%02d", hour,min,sec)
            }else {
                str = String(format: "%02d:%02d",min,sec)
            }
            return str
        }
    }
}
